<template>
  <el-dialog title="删除" :close-on-click-modal="false"  :visible.sync="show" class="dialog_del" :before-close="cancle">
    <p>确认要删除此信息吗？</p>
    <span slot="footer" class="dialog-footer">
      <el-button type="search" @click="submitForm">确认</el-button>
      <el-button @click="cancle">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>

import { frontMenuDel } from '@/api/front/frontMenu.js'
import { setErrorTip } from '@/utils/index.js'

export default {
  props: {
    show: Boolean,
    closeDialog: Function,
    idList: Array
  },
  methods:{
    cancle(){
      this.$emit('closeDialog')
    },
    submitForm(){
      this.delMenu()
    },
    delMenu(){
      let params = {
        relatetion_id: JSON.stringify(this.idList) 
      }
      frontMenuDel(params).then(res=>{
        if(res.state == 1){
          this.$message.success('删除成功')
          this.cancle()
        } else {
          this.$message.error('删除失败，失败原因:' + setErrorTip(res))
        }
      })
    }
  }
}
</script>

<style>

</style>